# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=posttester
pkgver=0.1
pkgrel=3
groups=('blackarch' 'blackarch-crypto')
pkgdesc='A jar file that will send POST requests to servers in order to test for the hash collision vulnerability discussed at the Chaos Communication Congress in Berlin.'
arch=('any')
url='http://packetstormsecurity.com/files/109010/MagicHash-Collision-Testing-Tool.html'
license=('unknown')
depends=('java-environment')
source=('https://dl.packetstormsecurity.net/UNIX/scanners/PostTester.jar')
sha512sums=('e990ceef6cbf744055e748bb67bdc7951534051305ee27b004aefed8f0ecfc78f556d4ec9d88deed11a4b7b712f8ba36d5ff408d20d295e9095c982d27c0db31')

package() {
  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 644 PostTester.jar "$pkgdir/usr/share/$pkgname/PostTester.jar"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec java -jar /usr/share/$pkgname/PostTester.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

